<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>想说啥 ？</title>
    <meta name="description" content="龙窝luck-想说啥" />
    <meta name="keywords" content="龙窝工作室,移动端,白龙,糖醋里脊,龙窝,许愿墙,凡君阿,425084984,黄新瑞,想说啥" />
    <link rel="shortcut icon" href="/icon.jpg">
    <!-- head 中 -->
    <link rel="stylesheet" href="https://cdn.bootcss.com/weui/1.1.2/style/weui.min.css">
    <link rel="stylesheet" href="https://cdn.bootcss.com/jquery-weui/1.2.0/css/jquery-weui.min.css">
    <!--动画-->
    <link rel="stylesheet" href="__TMPL__/public/view/css/animate.css">
    <!-- jQuery -->
    <script src="__TMPL__/public/view/js/jquery.min.js"></script>
</head>
<body>
    <!--许愿内容-->
    <div class="adsss" style="margin-bottom: 9em;margin-top: -1em;width: 100%">
        <div class="weui-cells ads"  style="font-size: 12px">

        </div>
    </div>
    <!-- 使用 WeUI -->
        <div class="weui-cells weui-cells_form down">
            <div class="weui-cell">
                <div class="weui-cell__bd">
                    <textarea class="weui-textarea text1" style="font-size: 14px;" placeholder="请输入......." rows="3"></textarea>
                    <div class="weui-textarea-counter">
                        <span id="max1">0</span>/240
                    </div>
                </div>
            </div>
            <div style="display: flex;flex-direction:row;padding: 1% 0;">
                <a href="javascript:" style="width: 98%;margin: auto;font-size: 14px;" class="weui-btn weui-btn_primary buoo">点击飞向外太空！</a>
            </div>
        </div>

        <script type="text/javascript" src="http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js"></script>
        <script>
            function clickaudio() {
                $.toast('正在开发中哦！', "text");
            }
        </script>
    <php>
        $view = file_get_contents('view.txt');
        $vp = $view + 1;
        file_put_contents("view.txt", $vp);
    </php>
    <script>
        window.onload = function(){
            $.ajax({
                url:'/blog/message/backmessage',
                type:"post",
                data:{},
                success:function(data){
                    var ress= $.parseJSON(data);
                    $.each(ress, function (n, value) {
                        $('.ads').prepend(
                            "<div class=\"weui-cell animated bounceInLeft\" id=\"isset\">"+
                            "<div class=\"weui-cell__bd\">"+
                            "<p>第 "+value.id+" 条</p>"+
                            "</div>"+
                            "<div class=\"weui-cell__ft ddddd\">"+
                            value.text+"<br>"+"来自："+value.ip+"&nbsp;"+value.time+
                            "</div>"+
                            "</div>"
                        );
                    });
                    $.toast('加载成功！');
                },
                error:function(e){
                    $.toast('加载失败！', "cancel");
                }
            });
        };
            $('.text1').bind(' input propertychange ',function(){
                var lenss = $('.text1').val().length;
                $('#max1').text(lenss);
                if(lenss > 240){
                    $('.buoo').hide();
                    $('.warning').css('color','red').text('字数超过限制！');
                }else if(lenss < 240){
                    $('.buoo').show();
                    $('.warning').text('写下你的愿望吧！');
                }
            } );
            $('.buoo').click(function(){
                var text0 = $('.text1').val();
                var ip1 = remote_ip_info['country']+remote_ip_info['city'];
                $('.buoo').text('发送中...');
                $.ajax({
                    url:'/blog/message/acceptmessage',
                    type:"post",
                    data:{
                        text1:text0,
                        ip1:ip1
                    },
                    success:function(data){
                        $('.buoo').text('点击飞向外太空！');
                        $('.text1').val('');
                        $('#max1').text(0);
                        var ress= $.parseJSON(data);
                        if(ress.sta){
                            $('.ads').prepend(
                                "<div class=\"weui-cell animated bounceInLeft\">"+
                                "<div class=\"weui-cell__bd\">"+
                                "<p>第 "+ress.ids+" 条</p>"+
                                "</div>"+
                                "<div class=\"weui-cell__ft ddddd\">"+
                                ress.text3+"<br>"+"来自："+ress.ip3+"&nbsp;"+ress.timee+
                                "</div>"+
                                "</div>"
                            );
                        }
                        if(ress.sta==1){
                            $.toast("谢谢你！");
                        }else{
                            $.toast(ress,'cancel');
                        }
                    },
                    error:function(e){
                        $('.buoo').text('点击飞向外太空！');
                        $.toast('失败啦！！', "cancel");
                    }
                });
            })
    </script>
    <!--style-->
    <style>
        .down{
            width: 100%;
            position: fixed;
            bottom: 0;
            z-index: 999;
        }
        .warning{
            color: black;
        }
    </style>
<!-- body 最后 -->
<script src="https://cdn.bootcss.com/jquery/1.11.0/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/jquery-weui/1.2.0/js/jquery-weui.min.js"></script>
    <script>
        (function(){
            var bp = document.createElement('script');
            var curProtocol = window.location.protocol.split(':')[0];
            if (curProtocol === 'https') {
                bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
            }
            else {
                bp.src = 'http://push.zhanzhang.baidu.com/push.js';
            }
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(bp, s);
        })();
    </script>
</body>
</html>